package com.yuncheng.spcyApi.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.yuncheng.spcyApi.entity.SpcySqsxBczgjl;
import com.yuncheng.spcyApi.mapper.SpcySqsxBczgjlMapper;
import com.yuncheng.spcyApi.service.ISpcySqsxBczgjlService;
import org.springframework.stereotype.Service;

import com.yuncheng.common.base.service.impl.BaseServiceImpl;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @Description: 审评查验-补充整改记录
 * @Author: yuncheng
 * @Date: 2023-09-04
 * @Version: V1.0
 */
@Service
public class SpcySqsxBczgjlServiceImpl extends BaseServiceImpl<SpcySqsxBczgjlMapper, SpcySqsxBczgjl> implements ISpcySqsxBczgjlService {

    @Resource
    private SpcySqsxBczgjlMapper spcySqsxBczgjlMapper;

    @Override
    public void updateWc(String sqsxid) {
        LambdaUpdateWrapper<SpcySqsxBczgjl> updateWrapper = new LambdaUpdateWrapper<>();
        updateWrapper.eq(SpcySqsxBczgjl::getFsqsxid, sqsxid);
        updateWrapper.eq(SpcySqsxBczgjl::getFwczt, "否");

        SpcySqsxBczgjl updateBean = new SpcySqsxBczgjl();
        updateBean.setFwczt("是");
        updateBean.setFwcrq(new Date());
        update(updateBean, updateWrapper);

    }

    @Override
    public Integer selectCountByFwczt(String sqsxid, String fwczt) {
        return spcySqsxBczgjlMapper.selectCountByFwczt(sqsxid, fwczt);
    }
}
